{include file="common/head"/}
<style>
    .layui-table-cell{height: auto;}
    .layui-table-cell ul li a{color: #1C8FEF;display: block;border: 1px solid #ececec;padding: 3px 8px;}
    .layui-table-cell ul li a:hover{color: #005580}
</style>
<div class="admin-main layui-anim layui-anim-upbit">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>录入列表</legend>
    </fieldset>
    <div class="layui-inline" style="float: right">
        <form class="layui-form" action="">
            <div class="layui-form-item" style="margin-bottom: 0px">
                <div class="layui-inline" style="margin-right: 0px">
                    <div class="layui-input-inline" style="width: 200px;">
                        <input type="text" id="keyword" name="keyword" autocomplete="off"placeholder="请输入教师姓名/工号/部门"class="layui-input">
                    </div>
                </div>
                <div class="layui-inline" style="margin-right: 0px">
                    <div class="layui-btn-group layui-inline" style="margin: 0px">
                        <a  href="{:url('index')}" class="layui-btn layui-btn-primary">重置</a>
                        <button id="search" class="layui-btn layui-btn-normal" type="button" lay-submit lay-filter="formDemo" style="background-color: #009688;">
                            <i class="layui-icon">&#xe615;</i>查找
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>

    <table class="layui-table" id="list" lay-filter="list"></table>
</div>

<script type="text/html" id="barDemo">
    <button  data-id="{{d.teacher_id}}" class="layui-btn layui-btn-xs entry_teacher layui-btn-normal">录入</button>
</script>


{include file="common/foot"/}
<script>
    layui.use('table', function() {
        var table = layui.table, $ = layui.jquery;var form = layui.form;
        var tableIn = table.render({
            id: 'user',
            elem: '#list',
            url: "{:url('index')}",
            method: 'post',
            page: true,
            even:true,
            cols: [[
                {field: 'teacher_no',title: '教师工号', width: 130,style:'height: auto;'},
                {field: 'true_name', title: '教师姓名', width: 100,templet:'#name'},
                {field: 'title', title: '所在部门', width: 200},
                {field: 'status_detail', title: '录入详情', width: 350},
                {field: 'check_detail', title: '审核详情', width: 350},
                {width: 150, align: 'center', toolbar: '#barDemo'}
            ]],
            limit: 10, //每页默认显示的数量
            done: function(res, curr, count){
                console.log(res.tongji);
                $('.layui-laypage-limits').append(" <span class=\"layui-laypage-limits\" style='margin-left: 50px;font-size: 20px'>"+res.tongji+"</span>");

            }
        });
        $('#search').on('click', function () {

            var keyword = $('#keyword').val();
            console.log(keyword);
            if ($.trim(keyword) === '') {
                layer.msg('{:lang("pleaseEnter")}查找信息！', {icon: 0});
                return;
            }
            //表格重载
            tableIn.reload({
                //传递额外参数
                where: {keyword: keyword}

            });
        });

        // 配置考核项录入
        $(document).on('click','.entry_teacher',function () {
            var id=$(this).attr('data-id');
            location.href = "{:url('entry_teacher')}?teacher_id="+id;
        });
    });
</script>
</body>
</html>